﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace test2
{
    public partial class Form5 : Form
    {
        public Form5()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.AddExtension = true;
            ofd.CheckFileExists = true;
            ofd.CheckPathExists = true;
            ofd.DefaultExt = "C:\\";
            if(radioImport.Checked)
            {
                ofd.Filter = "Image Files (*.BMP,*.JPG,*.JPEG)|*.bmp;*.jpg;*.jpeg";
            }
            if (ofd.ShowDialog() != DialogResult.OK)
                return;
            Bientoancuc.bienxy = ofd.FileName;
            
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (radioExport.Checked)

                if (radioExport.Checked)
                {
                    ((Form1)this.Owner.Owner).XUATDULIEU();
                    this.Owner.Owner.Show();
                    this.Hide();
                }
            if(radioImport.Checked)
            {
                this.Owner.Owner.Show();
                this.Hide();
            }
        }
    }
}
